<div class="divColorbox">
    <div class="divColorbox_Header">
        <span><i class="fa fa-star"></i><span>守护单据信息</span></span>
        <a class="Refresh"></a><a class="Close"></a>
    </div>
    <div class="divColorbox_Body row">
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">单据号</span>
                    <input id="Order_No" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">直播单号</span>
                    <input id="Live_Order_No" type="text" class="form-control" readonly/>
                    <span class="input-group-btn">
                        <a id="btnLiveOrderInfo" class="btn btn-default btn-sm" data-permission-code="{Order}[Room](Live-Info)" data-rel="tooltip" title="查看直播单信息">
                            <i class="fa fa-search"></i>
                        </a>
                    </span>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">公会名</span>
                    <input id="Family_Name" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护人ID</span>
                    <input id="User_ID" type="text" class="form-control" readonly/>
                    <span class="input-group-btn">
                        <a id="btnUserInfo" class="btn btn-default btn-sm" data-permission-code="{User}[Base](Info)" data-rel="tooltip" data-placement="left" data-original-title="查看用户">
                            <i class="fa fa-search"></i>
                        </a>
                    </span>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护人昵称</span>
                    <input id="User_NickName" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护人姓名</span>
                    <input id="User_RealName" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">被守护人ID</span>
                    <input id="User_ID_Guardian" type="text" class="form-control" readonly/>
                    <span class="input-group-btn">
                        <a id="btnGuardianInfo" class="btn btn-default btn-sm" data-permission-code="{User}[Base](Info)" data-rel="tooltip" data-placement="left" data-original-title="查看用户">
                            <i class="fa fa-search"></i>
                        </a>
                    </span>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">被守护人昵称</span>
                    <input id="User_NickName_Guardian" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">被守护人姓名</span>
                    <input id="User_RealName_Guardian" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护ID</span>
                    <input id="Guardian_ID" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护名称</span>
                    <input id="Guardian_Name" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">守护模式</span>
                    <input id="Guardian_Mode" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">公会提成</span>
                    <input id="Commission_Guardian_Family" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">艺人提成</span>
                    <input id="Commission_Guardian_Anchor" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">艺人公会</span>
                    <input id="Commission_Anchor_Family" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">艺人收入</span>
                    <input id="Order_Amt_Anchor" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">平台收入</span>
                    <input id="Order_Amt_Platform" type="text" class="form-control" data-rel="tooltip" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">公会收入</span>
                    <input id="Order_Amt_Family" type="text" class="form-control" data-rel="tooltip" readonly/>
                </div>
            </div>
        </div>
        <div class="space-6"></div>
        <div class="row">
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">订单金额</span>
                    <input id="Order_Amt" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">创建时间</span>
                    <input id="Create_Date" type="text" class="form-control" readonly/>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">创建IP</span>
                    <input id="Create_IP" type="text" class="form-control" readonly/>
                </div>
            </div>
        </div>
    </div>
    <div class="divColorbox_Footer">
        <button type="button" id="btnUndo"></button>
    </div>
</div>
<script src="<%- Virtual_Path.Static %>jquery.plugin/dataTables/jquery.dataTables.min.js"></script>
<script src="<%- Virtual_Path.Static %>jquery.plugin/dataTables/jquery.dataTables.bootstrap.min.js"></script>
<script>
    $(function () {
        //region 判断flag
        if (_PageData.flag !== 0) {
            $.KOC.Tips.Open('Error', _PageData.flag, {
                Timeout: 1000,
                onClose: function () {
                    parent.$.colorbox.close();
                }
            });
            return;
        }
        //endregion
        //region 页面数据绑定
        $('#Order_No').val(_PageData.Order_No);
        $('#Live_Order_No').val(_PageData.Order_Guardian.Live_Order_No);
        $('#Family_Name').val(_PageData.Order_Guardian.Family_Name);
        //region 守护人
        $('#User_ID').val(_PageData.Order_Guardian.User_ID);
        $('#User_NickName').val(_PageData.Order_Guardian.User_NickName);
        $('#User_RealName').val(_PageData.Order_Guardian.User_RealName);
        //endregion
        //region 被守护人
        $('#User_ID_Guardian').val(_PageData.Order_Guardian.User_ID_Guardian);
        $('#User_NickName_Guardian').val(_PageData.Order_Guardian.User_NickName_Guardian);
        $('#User_RealName_Guardian').val(_PageData.Order_Guardian.User_RealName_Guardian);
        //endregion
        $('#Guardian_ID').val(_PageData.Order_Guardian.Guardian_ID);
        $('#Guardian_Name').val(_PageData.Order_Guardian.Guardian_Name);
        $('#Guardian_Mode').val(_PageData.Order_Guardian.Guardian_Mode);

        $('#Commission_Guardian_Family').val(_PageData.Order_Guardian.Commission_Guardian_Family);
        $('#Commission_Guardian_Anchor').val(_PageData.Order_Guardian.Commission_Guardian_Anchor);
        $('#Commission_Anchor_Family').val(_PageData.Order_Guardian.Commission_Anchor_Family);

        $('#Order_Amt').val(_PageData.Order_Guardian.Order_Amt);
        $('#Order_Amt_Anchor').val(_PageData.Order_Guardian.Order_Amt_Anchor);
        $('#Order_Amt_Platform').val(_PageData.Order_Guardian.Order_Amt_Platform);
        $('#Order_Amt_Family').val(_PageData.Order_Guardian.Order_Amt_Family);

        $('#PurchaseMode').val(_PageData.Order_Guardian.PurchaseMode == 1 ? '购买' : '包裹');
        $('#IsTask').val(_PageData.Order_Guardian.IsTask ? '是' : '否');

        $('#Create_Date').val(moment(_PageData.Order_Guardian.Create_Date).format('YYYY/MM/DD HH:mm:ss'));
        $('#Create_IP').val(_PageData.Order_Guardian.Create_IP);
        //endregion
        if (_PageData.Order_Guardian.Live_Order_No) {
            $('#btnLiveOrderInfo').click(function () {
                $.CommonAdmin.OpenWindow(_PageData.Order_Guardian.Live_Order_No);
            });
        } else {
            $('#btnLiveOrderInfo').remove();
        }
        if (_PageData.Order_Guardian.User_ID) {
            $('#btnUserInfo').click(function () {
                $.CommonAdmin.OpenWindow(':UserInfo:' + _PageData.Order_Guardian.User_ID);
            });
        } else {
            $('#btnUserInfo').remove();
        }
        if (_PageData.Order_Guardian.User_ID_Guardian) {
            $('#btnGuardianInfo').click(function () {
                $.CommonAdmin.OpenWindow(':UserInfo:' + _PageData.Order_Guardian.User_ID_Guardian);
            });
        } else {
            $('#btnGuardianInfo').remove();
        }
    });
</script>